package game.game.network.cmd;

import entity.Position;
import entity.object.StaticObject;
import json.JSONObject;
import game.engine.network.client.IControllerClient;
import game.engine.network.cmd.CmdServer;
import game.engine.network.cmd.EnumCommand;
import game.game.network.client.IGameClientController;

public class CmdSReturnStaticObject extends CmdServer
{
	public CmdSReturnStaticObject(JSONObject pObject)
	{
		super( pObject );
	}

	public CmdSReturnStaticObject(StaticObject pStaticObject)
	{
		super( EnumCommand.CMD_SERV_RETURN_STATIC_OBJECT );
		addParam( CmdSReturnPosition.IDOBJ , pStaticObject.getId() );
		addParam( CmdSReturnPosition.POSITIONX , pStaticObject.getPosition().getX() );
		addParam( CmdSReturnPosition.POSITIONY , pStaticObject.getPosition().getY() );
	}

	@Override
	public void execute( IControllerClient pController )
	{
		((IGameClientController) pController).execute( this );

	}

	public StaticObject getStaticObject()
	{
		return new StaticObject( 0, new Position( 0, 0 ) );
	}
}
